<include file="public@header" />
</head>
<body>

    <div class="wrap js-check-wrap">

        <!-- 顶部标签区域 -->
        <ul class="nav nav-tabs">
            <li><a href="{:url('index')}">所有{$_title}</a></li>
            <li class="active">
                <a href="javascript:;">
                    {$formMethod=='post'?'添加':'编辑'}{$_title}
                    {:isset($formData['id'])?'（ID:'.$formData['id'].'）':''}
                </a>
            </li>
        </ul>

        <!-- 表单部分 -->
        <form action="{$formAction}" method="{$formMethod}" class="form-horizontal js-ajax-form margin-top-20">
            <div class="row">
                <div class="col-md-12">
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <th width="100">品牌名称<span class="form-required">*</span></th>
                                <td>
                                    <input class="form-control" type="text" name="form[title]" required
                                        placeholder="请输入品牌名称"
                                        {:isset($formData['title'])?'value="'.$formData['title'].'"':''} />
                                </td>
                            </tr>
                            <tr>
                                <th>品牌别名</th>
                                <td>
                                    <input class="form-control" type="text" name="form[alias]" placeholder="请输入品牌别名"
                                        {:isset($formData['alias'])?'value="'.$formData['alias'].'"':''} />
                                    <p class="help-block">无别名可留空</p>
                                </td>
                            </tr>
                            <tr>
                                <th>品牌官网</th>
                                <td>
                                    <input class="form-control" type="text" name="form[url]" placeholder="请输入品牌官网"
                                    {:isset($formData['url'])?'value="'.$formData['url'].'"':''} />
                                    <p class="help-block">可留空</p>
                                </td>
                            </tr>
                            <tr>
                                <th>品牌介绍</th>
                                <td>
                                    <script type="text/plain" id="description" name="form[description]">
                                        {:isset($formData['description'])?$formData['description']:''} </script>
                                </td>
                            </tr>
                            <tr>
                                <th>LOGO</th>
                                <td>
                                    <div style="text-align: center;">

                                        <input type='hidden' name='form[logo]' id='logo' {:isset($formData['logo'])?'value="'.$formData['logo'].'"':''} />
                                    <a href="javascript:uploadOneImage('图片上传','#logo');">
                                        <empty name="formData.logo">
                                            <img src="__TMPL__/public/assets/images/default-thumbnail.png" id='logo-preview' width='135' height='135' style='cursor: hand' />
                                        <else />
                                            <img src="{:cmf_get_image_preview_url($formData['logo'])}" id='logo-preview' width='135' height='135' style='cursor: hand' />
                                        </empty>
                                        </a>
                                        <br>
                                        <input type="button" class="btn btn-sm btn-cancel-logo"
                                            onclick="$('#logo-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#logo').val('');return false;"
                                            value="取消图片">

                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>状态</th>
                                <td>
                                    <div class="checkbox">
                                        <label><input type="checkbox" name="form[status]" value="1" {:isset($formData['status'])?($formData['status']?'checked':''):''}>发布</label>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <!-- <notempty name="formData.id"><input type="text" name="form[id]" value="{$formData.id}"></notempty> -->
                            <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                            <a class="btn btn-default" href="{:url('index')}">{:lang('BACK')}</a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <script type="text/javascript" src="__STATIC__/js/admin.js?v={$_static_version}"></script>
    <script type="text/javascript">
        //编辑器路径定义
        var editorURL = GV.WEB_ROOT;
    </script>
    <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript">
        $(function () {
            editorcontent = new baidu.editor.ui.Editor();
            editorcontent.render('description');
            try {
                editorcontent.sync();
            } catch (err) {
            }
        });
    </script>
</body>

</html>